Class sjl.HashMultiSet
All Packages Class Hierarchy This Package Previous Next Index
Class sjl.HashMultiSet
java.lang.Object
|
+----sjl.HashMultiSet
- public class HashMultiSet
- extends Object
- implements AssociativeContainer
HashMultiSet
is a kind of associative container that supports
unique keys (contains at most one of each key value) and provides
for fast retrieval of the keys themselves.
Copyright © 1996 Finn Bock
-
HashMultiSet()
- Construct an empty set.
-
HashMultiSet(InputIterator, InputIterator)
- Construct a set and initialize it with the elements in the
range
[first,last)
.
-
begin()
- Returns the iterator that represents the beginning of the set.
-
beginGeneric()
- Returns the iterator that represents the beginning of the set as an
untyped iterator.
-
beginRef()
- Returns a reference to the iterator that represents the beginning
of the set.
-
count(Object)
- Returns the number of element with a key equal to value.
-
empty()
- Returns
true
if the set does not contain any elements.
-
end()
- Returns the iterator that represents the end of the set.
-
endGeneric()
- Returns the iterator that represents the end of the set as an
untyped iterator.
-
endRef()
- Returns a reference to the iterator that represents the end of the set.
-
equal_range(Object)
- Returns a pair like
Pair(lower_bound(value), upper_bound(value))
.
-
equals(Object)
- Compare the elements in this container with the elements
in another container.
-
erase(Iterator)
- Erase the element pointed to by the iterator.
-
erase(Iterator, Iterator)
- Erase the elements in the range
[first,last)
.
-
erase(Object)
- Erase the element with key equal to value.
-
find(Object)
- Search the set for an element with a key equal to value.
-
flush()
- Erase all the elements in the container.
-
insert(InputIterator, InputIterator)
- Insert the elements from the range
[first,last)
into
the set.
-
insert(Object)
- Insert an element into the set.
-
max_size()
- Returns the maximum number of elements allowed in a set.
-
size()
- Returns the number of elements in the set.
HashMultiSet
public HashMultiSet()
- Construct an empty set.
HashMultiSet
public HashMultiSet(InputIterator first,
InputIterator last)
- Construct a set and initialize it with the elements in the
range
[first,last)
.
- Parameters:
- first - The beginning of the range.
- last - The end of the range.
flush
public void flush()
- Erase all the elements in the container.
equals
public boolean equals(Object container)
- Compare the elements in this container with the elements
in another container.
- Returns:
-
true
is the elements match.
- Overrides:
- equals in class Object
begin
public ForwardIterator begin()
- Returns the iterator that represents the beginning of the set.
beginRef
public ForwardIterator beginRef()
- Returns a reference to the iterator that represents the beginning
of the set.
end
public ForwardIterator end()
- Returns the iterator that represents the end of the set.
endRef
public ForwardIterator endRef()
- Returns a reference to the iterator that represents the end of the set.
beginGeneric
public ForwardIterator beginGeneric()
- Returns the iterator that represents the beginning of the set as an
untyped iterator.
endGeneric
public ForwardIterator endGeneric()
- Returns the iterator that represents the end of the set as an
untyped iterator.
size
public int size()
- Returns the number of elements in the set.
max_size
public int max_size()
- Returns the maximum number of elements allowed in a set.
empty
public boolean empty()
- Returns
true
if the set does not contain any elements.
insert
public HashtblIterator insert(Object value)
- Insert an element into the set. The element is only inserted if
there is no element in the container with a key equal to the key
of value.
- Parameters:
- value - The element to insert.
- Returns:
- An iterator that point to the newly inserted element
insert
public void insert(InputIterator first,
InputIterator last)
- Insert the elements from the range
[first,last)
into
the set.
- Parameters:
- first - The beginning of the range.
- last - The end of the range.
erase
public void erase(Iterator position)
- Erase the element pointed to by the iterator.
- Parameters:
- position - Points to the element to be removed.
erase
public int erase(Object value)
- Erase the element with key equal to value.
- Returns:
- The number of element erased.
erase
public void erase(Iterator first,
Iterator last)
- Erase the elements in the range
[first,last)
.
- Parameters:
- first - The beginning of the range.
- last - The end of the range.
find
public ForwardIterator find(Object value)
- Search the set for an element with a key equal to value.
- Parameters:
- value - The key to search for.
- Returns:
- An Iterator pointing to the element with a key equal to value,
or end() if such an element is not found.
count
public int count(Object value)
- Returns the number of element with a key equal to value.
equal_range
public Pair equal_range(Object value)
- Returns a pair like
Pair(lower_bound(value), upper_bound(value))
.
All Packages Class Hierarchy This Package Previous Next Index